#ifndef __TY_SPRITE_H__
#define __TY_SPRITE_H__

#include "TYBase.h"

class TYSprite : public CCSprite, public CCTargetedTouchDelegate
{
public:
	TYSprite(void);
	~TYSprite(void);

	int getPriority ();
	void setPriority (int var);

	void setSwallowsTouches (bool var);
	bool getSwallowsTouches ();

	void setTYTouchEnable (bool var);
	bool getTYTouchEnable ();


	CCRect rect();
	CCRect GetWindowRect();
	virtual void onEnter();
	virtual void onExit();

	bool containsTouchLocation(CCSprite* pSpirte, CCTouch* touch);
	bool containsTouchLocation(CCTouch* touch);
	virtual bool ccTouchBegan(CCTouch* touch, cocos2d::CCEvent* event);
	virtual void ccTouchMoved(CCTouch* touch, cocos2d::CCEvent* event){}
	virtual void ccTouchEnded(CCTouch* touch, cocos2d::CCEvent* event){}
	virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent) {}

	static TYSprite* spriteWithFile(const char *pszFileName);

private:
	int  m_nTYPriority;
	bool m_bTYSwallowsTouches;
	bool m_bTYIsTouchEnable;

};

#endif //__TY_SPRITE_H__